package org.imsetal.ilapi.client;

import org.imsetal.ilapi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

@Service
public class IlUserServiceClientByWebClient {
    @Autowired
    private WebClient.Builder webClientBuilder;

    public Mono<Result> checkUserExist(Long userid){
        return webClientBuilder.build()
                .get()
                .uri("http://il-user-service/userInfo/checkUserExist?userid={userid}",userid)
                .retrieve()
                .bodyToMono(Result.class);
    }
}
